addSerialListener

abstract fun addSerialListener(@NonNull listener: SerialListener)

Registers a SerialListener to receive data from connected serial devices.

This listener is invoked when data is received on a configured serial port (e.g., RS-232, USB-to-Serial adapter). This allows the player to interact with external hardware devices that communicate over a serial interface. The specifics of serial port configuration (baud rate, data bits, etc.) are typically handled by the player's system settings or a dedicated serial service.

Ensure removeSerialListener is called when the listener is no longer required to prevent potential memory leaks.

Parameters

listener

The non-null SerialListener instance to register.

See also

Throws

if listener is null.